/*
 * Copyright (c) 2007-2021 西安交通信息投资营运有限公司 版权所有
 */

package com.xci.xajtfb.om.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.xci.xajtfb.om.dao.BasicCustomerDao;
import com.xci.xajtfb.om.entity.BasicCustomer;
import com.xci.xajtfb.om.filter.BasicCustomerFilter;
import com.github.lvyanyang.core.BaseService;
import com.github.lvyanyang.core.PageList;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

/**
 * 客户档案服务
 * @author 吕艳阳 lvyanyang@xci96716.com
 * @since 2021-02-04 19:05:25
 */
@Service
@DS("master")
public class BasicCustomerService extends BaseService {
    /** 客户档案数据层对象 */
    @Resource private BasicCustomerDao basicCustomerDao;

    /**
     * 根据主键查询单个客户档案
     * @param id 客户档案主键
     * @return 返回客户档案实体
     */
    public BasicCustomer selectById(@NotNull(message = "请指定客户档案主键") Long id) {
        return basicCustomerDao.selectById(id);
    }

    /**
     * 查询客户档案分页列表
     * @param filter 过滤条件
     * @return 返回客户档案分页列表
     */
    public PageList<BasicCustomer> selectPageList(BasicCustomerFilter filter) {
        return PageList.of(basicCustomerDao.selectPageList(filter));
    }
}